var mongoose = require('mongoose')
mongoose.connect('mongodb://localhost/jiugu')
var Schema = mongoose.Schema
var postInfoSchema = new Schema({
	postId:{//帖子号
		type:Number,
		required:false
	},
	publisher:{//发布者
		type: String,
		required:true
	},
	title:{//标题
		type: String,
		required:true
	},
	content:{//内容
		type: String,
		required:true
	},
	readCount:{//阅读量
		type:Number,
		default: 0,
		required:true
	},
	praisePerson:[{//点赞人
		type:String,
		default: '李董',
		required:false
	}],
	commentCount:{//评论量
		type:Number,
		default: 0,
		required:true
	},
	pubDate:{//发布时间
		type:String,
		required:true
	},
	collegeId:{//帖子部门号
		type:Number,
		required:true
	},
	type:{
		type: String,
		required: true,
		default: '0'
	}
})
module.exports = mongoose.model('postInfo',postInfoSchema)